const fs=require('fs');
function myReadFile(filename){
	return new Promise((resolve,reject)=>{
		fs.readFile(filename,'utf-8',(err,data)=>{
			/*if(err){
				reject(err);
			}else{
				resolve(data.length);
			}*/
			err?reject(err):resolve(data.length);
		})
	});
};
myReadFile('./files/a.txt').then(result=>{
	console.log(result);
	return myReadFile('./files/b.txt');
}).then(result=>{
	console.log(result);
	return myReadFile('./files/c.txt')
}).then(result=>{
	console.log(result);
}).catch(err=>{
	console.log(err);
});